<?php

class PTGenreModel extends CI_Model {
	function getPTGenre($genre, $gender){
		$this->db->select('*');
		$this->db->from('ptgenre');
		$this->db->where('GENREID',$genre);
		$this->db->where('GENDERFANS',$gender);
		$data = $this->db->get();
		return $data;
	}
	
	function getPTGender($gender){
		$this->db->select('*');
		$this->db->from('ptgenre');
		$this->db->where('GENDERFANS',$gender);
		$data = $this->db->get();
		return $data;
	}
	
	function getGenre(){
		$this->db->distinct();
		$this->db->select('GENREID');
		$this->db->from('ptgenre');
		$this->db->order_by('GENREID', 'asc');
		$data = $this->db->get();
		return $data;		
	}
	
	function add_PTGenre($GENREID, $GENDERFANS, $SKOROPEN, $SKORCONSCIENT, $SKOREXTRA, $SKORNEURO, $SKORAGREE) {
//		$ID_MEMBER = $this->session->userdata('member_id');
//		$ID_PAKET = $this->input->post('ID_PAKET');
//		$WAKTU_PEMESANAN = gmDate("Y-m-d\TH:i:s\Z");
		$data = array(
			'GENREID' => $GENREID,
			'GENDERFANS' => $GENDERFANS,
			'SKOROPEN' => $SKOROPEN, //gimana nge-get waktu dan tanggal sekarang?
			'SKORCONSCIENT' => $SKORCONSCIENT,
			'SKOREXTRA' => $SKOREXTRA,
			'SKORNEURO' => $SKORNEURO,
			'SKORAGREE' => $SKORAGREE,
			);
		$this->db->insert('ptgenre', $data);
	}
}


?>